[
	{
		"group": "v3.1.1 PUBREC",
		"tests": [
			{ "name": "50 [MQTT-3.1.0-1]", "ver":4, "connect":false, "msgs": [{"type":"send", "payload":"50 02 0001"}]},
			{ "name": "50 unsolicited", "ver":4, "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 02 0001"},
				{"type":"recv", "payload":"62 02 0001"}
			] },
			{ "name": "50 unsolicited long", "ver":4, "msgs": [{"type":"send", "payload":"50 03 0001 00"}]},
			{ "name": "50 unsolicited mid 0", "ver":4, "msgs": [{"type":"send", "payload":"50 02 0000"}]},
			{ "name": "50 unsolicited short 0", "ver":4, "msgs": [{"type":"send", "payload":"50 00"}]},
			{ "name": "50 unsolicited short 1", "ver":4, "msgs": [{"type":"send", "payload":"50 01 01"}]},
			{ "name": "51 unsolicited", "ver":4, "msgs": [{"type":"send", "payload":"51 02 0001"}]},
			{ "name": "52 unsolicited", "ver":4, "msgs": [{"type":"send", "payload":"52 02 0001"}]},
			{ "name": "54 unsolicited", "ver":4, "msgs": [{"type":"send", "payload":"54 02 0001"}]},
			{ "name": "58 unsolicited", "ver":4, "msgs": [{"type":"send", "payload":"58 02 0001"}]}
		]
	},
	{
		"group": "v5.0   PUBREC",
		"tests": [
			{ "name": "50 [MQTT-3.1.0-1] (no reason code)", "ver":5, "connect":false, "msgs": [{"type":"send", "payload":"50 02 0001"}]},
			{ "name": "50 [MQTT-3.1.0-1]", "ver":5, "connect":false, "msgs": [{"type":"send", "payload":"50 03 0001 00"}]},
			{ "name": "50 unsolicited long", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 00 00"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 unsolicited mid 0", "ver":5, "msgs": [
				{"type":"send", "payload":"50 03 0000 00"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 unsolicited short 0", "ver":5, "msgs": [
				{"type":"send", "payload":"50 00"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 unsolicited short 1", "ver":5, "msgs": [
				{"type":"send", "payload":"50 01 01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 unsolicited len=2", "ver":5, "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 02 0001"},
				{"type":"recv", "payload":"62 02 0001"}
			]},
			{ "name": "50 unsolicited len=3", "ver":5, "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 03 0001 00"},
				{"type":"recv", "payload":"62 02 0001"}
			]},
			{ "name": "50 unsolicited len=3 fail", "ver":5, "expect_disconnect":false, "msgs": [{"type":"send", "payload":"50 03 0001 80"}]},
			{ "name": "50 unsolicited len=4 ok", "ver":5, "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 04 0001 00 00"},
				{"type":"recv", "payload":"62 02 0001"}
			]},
			{ "name": "50 unsolicited len=4 rc=fail", "ver":5, "expect_disconnect":false, "msgs": [{"type":"send", "payload":"50 04 0001 80 00"}]},
			{ "name": "50 unsolicited len=4 rc=unknown", "ver":5, "msgs": [
				{"type":"send", "payload":"50 04 0001 FF 00"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 unsolicited len=4 short", "ver":5, "msgs": [
				{"type":"send", "payload":"50 04 0001 00 01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "51 unsolicited", "ver":5, "msgs": [
				{"type":"send", "payload":"51 03 0001 00"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "52 unsolicited", "ver":5, "msgs": [
				{"type":"send", "payload":"52 03 0001 00"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "54 unsolicited", "ver":5, "msgs": [
				{"type":"send", "payload":"54 03 0001 00"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "58 unsolicited", "ver":5, "msgs": [
				{"type":"send", "payload":"58 03 0001 00"},
				{"type":"recv", "payload":"E0 01 81"}
			]}
		]
	},
	{
		"group": "v5.0   PUBREC ALLOWED PROPERTIES",
		"tests": [
			{ "name": "50 with reason-string property", "ver":5, "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 1F000170"},
				{"type":"recv", "payload":"62 02 0001"}
			]},
			{ "name": "50 with 2*reason-string property", "ver":5, "msgs": [
				{"type":"send", "payload":"50 0C 0001 00 08 1F000170 1F000171"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with reason-string property missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 1F"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with user-property", "ver":5, "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 0B 0001 00 07 26000170000171"},
				{"type":"recv", "payload":"62 02 0001"}
			]},
			{ "name": "50 with 2*user-property", "ver":5, "expect_disconnect":false, "msgs": [
				{"type":"send", "payload":"50 12 0001 00 0E 26000170000171 26000170000171"},
				{"type":"recv", "payload":"62 02 0001"}
			]},
			{ "name": "50 with user-property missing value", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 23000170"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with user-property missing key,value", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 23"},
				{"type":"recv", "payload":"E0 01 81"}
			]}
		]
	},
	{
		"group": "v5.0   PUBREC DISALLOWED PROPERTIES",
		"tests": [
			{ "name": "50 with payload-format-indicator (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0100"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with request-problem-information (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 1700"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with maximum-qos (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 2400"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with retain-available (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 2500"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with wildcard-subscription-available (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 2800"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with subscription-identifier-available (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 2900"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with shared-subscription-available (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 2A00"},
				{"type":"recv", "payload":"E0 01 82"}
			]},

			{ "name": "50 with payload-format-indicator (byte) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with request-problem-information (byte) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 17"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with maximum-qos (byte) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 24"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with retain-available (byte) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 25"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with wildcard-subscription-available (byte) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 28"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with subscription-identifier-available (byte) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 29"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with shared-subscription-available (byte) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 2A"},
				{"type":"recv", "payload":"E0 01 81"}
			]},

			{ "name": "50 with message-expiry-interval (four byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 09 0001 00 05 0200000001"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with session-expiry-interval (four byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 09 0001 00 05 1100000001"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with will-delay-interval (four byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 09 0001 00 05 1800000001"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with maximum-packet-size (four byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 09 0001 00 05 2700000001"},
				{"type":"recv", "payload":"E0 01 82"}
			]},

			{ "name": "50 with message-expiry-interval (four byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 02"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with session-expiry-interval (four byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 11"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with will-delay-interval (four byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 18"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with maximum-packet-size (four byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 27"},
				{"type":"recv", "payload":"E0 01 81"}
			]},

			{ "name": "50 with content-type (UTF-8 string)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 03000170"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with response-topic (UTF-8 string)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 08000170"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with assigned-client-identifier (UTF-8 string)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 12000170"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with authentication-method (UTF-8 string)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 15000170"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with response-information (UTF-8 string)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 1A000170"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with server-reference (UTF-8 string)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 1C000170"},
				{"type":"recv", "payload":"E0 01 82"}
			]},

			{ "name": "50 with content-type (UTF-8 string) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 03"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with response-topic (UTF-8 string) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 08"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with assigned-client-identifier (UTF-8 string) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 12"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with authentication-method (UTF-8 string) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 15"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with response-information (UTF-8 string) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 1A"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with server-reference (UTF-8 string) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 1C"},
				{"type":"recv", "payload":"E0 01 81"}
			]},

			{ "name": "50 with correlation-data (binary data)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 09000170"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with authentication-data (binary data)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 16000170"},
				{"type":"recv", "payload":"E0 01 82"}
			]},

			{ "name": "50 with correlation-data (binary data) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 09"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with authentication-data (binary data) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 16"},
				{"type":"recv", "payload":"E0 01 81"}
			]},

			{ "name": "50 with subscription-identifier (variable byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0B01"},
				{"type":"recv", "payload":"E0 01 82"}
			]},

			{ "name": "50 with subscription-identifier (variable byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 0B"},
				{"type":"recv", "payload":"E0 01 81"}
			]},

			{ "name": "50 with server-keep-alive (two byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 07 0001 00 03 130101"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with receive-maximum (two byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 07 0001 00 03 210101"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with topic-alias-maximum (two byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 07 0001 00 03 220101"},
				{"type":"recv", "payload":"E0 01 82"}
			]},
			{ "name": "50 with topic-alias (two byte integer)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 07 0001 00 03 230101"},
				{"type":"recv", "payload":"E0 01 82"}
			]},

			{ "name": "50 with server-keep-alive (two byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 13"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with receive-maximum (two byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 21"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with topic-alias-maximum (two byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 22"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with topic-alias (two byte integer) missing", "ver":5, "msgs": [
				{"type":"send", "payload":"50 05 0001 00 01 23"},
				{"type":"recv", "payload":"E0 01 81"}
			]},

			{ "name": "50 with invalid-property 0x00 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0001"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x04 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0401"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x05 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0501"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x06 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0601"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x07 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0701"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x0A (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0A01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x0C (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0C01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x0D (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0D01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x0E (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0E01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x0F (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 0F01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x10 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 1001"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x14 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 1401"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x1B (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 1B01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x1D (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 1D01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x1E (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 1E01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x20 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 2001"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x7F (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 06 0001 00 02 7F01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with invalid-property 0x8000 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 07 0001 00 03 800001"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x8001 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 07 0001 00 03 800101"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0xFF7F (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 07 0001 00 03 FF7F01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x808001 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 80800101"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0xFFFF7F (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 08 0001 00 04 FFFF7F01"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0x80808001 (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 09 0001 00 05 8080800101"},
				{"type":"recv", "payload":"E0 01 81"}
			]},
			{ "name": "50 with unknown-property 0xFFFFFF7F (byte)", "ver":5, "msgs": [
				{"type":"send", "payload":"50 09 0001 00 05 FFFFFF7F01"},
				{"type":"recv", "payload":"E0 01 81"}
			]}
		]
	}
]
